<?php
session_start();
if (isset($_SESSION['user'])) {
    header('Location: ../main.php');
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <title>EaSoftCollege 2.0</title>
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <script src="../js/jquery.js"></script>
        <script src="../js/angulars1.7.min.js"></script>
        <script src="js/modernizr.custom.63321.js"></script>
        <!--[if lte IE 7]><style>.main{display:none;} .support-note .note-ie{display:block;}</style><![endif]-->
        <style>	
            @import url(http://fonts.googleapis.com/css?family=Raleway:400,700);
            body {
                background: #7f9b4e url(clouds2.jpg) no-repeat center top;
                -webkit-background-size: cover;
                -moz-background-size: cover;
                background-size: cover;
            }
            .container > header h1,
            .container > header h2 {
                color: #fff;
                text-shadow: 0 1px 1px rgba(0,0,0,0.7);
            }
        </style>
    </head>
    <body>
        <div class="container">

            <!-- Codrops top bar -->
            <div class="codrops-top">
                <a href="http://www.easoftware.net/">
                    <strong>EASOFTWARE.NET </strong>
                </a>
                <span class="right">
                    <a href="#">CINDE</a>
                </span>
            </div><!--/ Codrops top bar -->

            <header>

                <h1><strong>EaSoftCollege</strong> 2.0</h1>
                <h2>Developed by EaSoftware for:</h2>

                <div class="support-note">
                    <span class="note-ie">Sorry, only modern browsers.</span>
                </div>
                <div>
                    <img src="../img/logocinde.png" width="80" height="75" />
                </div>
                <?php
                if (isset($_SESSION["error"])) {
                    $e = $_SESSION["error"];
                    ?>
                    <div style="color:red;" >
                        <p>
                            <strong>Error: <?php echo $e ?>.</strong>
    <?php ?>
                        </p>
                    </div>
<?php } ?>
            </header>

            <section class="main">
                <form method="post" action="../include/login.php" class="form-4">
                    <h1>Datos Usuario</h1>
                    <p>
                        <label for="usuario">Usuario</label>
                        <input type="text" name="usuario" placeholder="Usuario" required>
                    </p>
                    <p>
                        <label for="clave">Contrase&ntilde;a</label>
                        <input type="password" name='clave' placeholder="Contrase&ntilde;a" required> 
                    </p>
                    <?php
                    require_once('../include/db.inc.php');
                    include('../cfg/cfg.inc.php');
                    $db = new DbManager();
                    $db->connect(DBHOST, DBUSER, DBPWD, true, true, DBNAME, "");
                    $list = $db->query_select("cllg_entity", NULL);
                    ?>
                    <p>
                        <label for="entidad">Entidad</label>
                        <select name="entidad" id="entidad" placeholder="Entidad educativa" required>
                            <option value="">-Entidad-</option>
                            <?php foreach ($list as $it) { ?>
                                <option value="<?php echo $it["ID"]; ?>" > <?php echo $it["NAME"]; ?> </option>
<?php } ?>
                        </select>
                    </p>
                    <p>
                        <input type="submit" name="submit" value="Continuar">
                    </p>  
                </form>​
            </section>

        </div>
    </body>
</html>